﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ViewState.aspx.cs" Inherits="ViewState" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Test View state</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <asp:Table ID="Table1" runat="server" BorderWidth="0px" BorderStyle="Solid" Caption="View State">
        <asp:TableRow runat="server">
          <asp:TableCell runat="server" Font-Bold="True" HorizontalAlign="Center" Width="250px">Label</asp:TableCell>
          <asp:TableCell runat="server" Font-Bold="True" HorizontalAlign="Center" Width="150px">Action</asp:TableCell>
          <asp:TableCell runat="server" Font-Bold="True" HorizontalAlign="Center" ColumnSpan="2" Width="150px">EnableViewState</asp:TableCell>
          <asp:TableCell runat="server" Width="50px" /> 
          <asp:TableCell runat="server" Font-Bold="True" HorizontalAlign="Center" ColumnSpan="2" Width="150px">ViewStateMode</asp:TableCell>
        </asp:TableRow>

        <asp:TableRow runat="server">
          <asp:TableCell runat="server">
            <asp:Label ID="Label1" runat="server" Text="Page post back: " EnableViewState="False" ViewStateMode="Disabled"></asp:Label>
          </asp:TableCell>
          <asp:TableCell runat="server">
            <asp:Button ID="Button1" runat="server" Text="Submit" onclick="Button1_Click" />
          </asp:TableCell>
          <asp:TableCell runat="server">
            <asp:Button ID="Button1_VSEnable" runat="server" Text="Change" onclick="Button1_VSEnable_Click" />
          </asp:TableCell>
          <asp:TableCell runat="server" HorizontalAlign="Right">
            <asp:Label ID="Page_VSEnable" runat="server"></asp:Label>
          </asp:TableCell>
          <asp:TableCell runat="server" /> 
          <asp:TableCell runat="server">
            <asp:Button ID="Button1_VSMode" runat="server" Text="Change" onclick="Button1_VSMode_Click" />
          </asp:TableCell>
          <asp:TableCell runat="server" HorizontalAlign="Right">
            <asp:Label ID="Page_VSMode" runat="server"></asp:Label>
          </asp:TableCell>
        </asp:TableRow>

        <asp:TableRow runat="server">
          <asp:TableCell runat="server">
            <asp:Label ID="Label2" runat="server" Text='Initial ViewStateMode = "Enabled"' ForeColor="Black" ViewStateMode="Enabled"></asp:Label>
          </asp:TableCell>
          <asp:TableCell ID="TableCell1" runat="server">
            <asp:Button ID="Button2_ChangeColor" runat="server" Text="Change color" onclick="Button2_ChangeColor_Click" />
          </asp:TableCell>
          <asp:TableCell runat="server">
            <asp:Button ID="Button2_VSEnable" runat="server" Text="Change" onclick="Button2_VSEnable_Click" />
          </asp:TableCell>
          <asp:TableCell runat="server" HorizontalAlign="Right">
            <asp:Label ID="Label2_VSEnable" runat="server"></asp:Label>
          </asp:TableCell>
          <asp:TableCell runat="server" /> 
          <asp:TableCell runat="server">
            <asp:Button ID="Button2_VSMode" runat="server" Text="Change" onclick="Button2_VSMode_Click" />
          </asp:TableCell>
          <asp:TableCell runat="server" HorizontalAlign="Right">
            <asp:Label ID="Label2_VSMode" runat="server"></asp:Label>
          </asp:TableCell>
        </asp:TableRow>

        <asp:TableRow runat="server">
          <asp:TableCell runat="server">
            <asp:Label ID="Label3" runat="server" Text='Initial ViewStateMode = "Inherit"' ForeColor="Black" ViewStateMode="Inherit"></asp:Label>
          </asp:TableCell>
          <asp:TableCell runat="server">
            <asp:Button ID="Button3_ChangeColor" runat="server" Text="Change color" onclick="Button3_ChangeColor_Click" />
          </asp:TableCell>
          <asp:TableCell runat="server">
            <asp:Button ID="Button3_VSEnable" runat="server" Text="Change" onclick="Button3_VSEnable_Click" />
          </asp:TableCell>
          <asp:TableCell runat="server" HorizontalAlign="Right">
            <asp:Label ID="Label3_VSEnable" runat="server"></asp:Label>
          </asp:TableCell>
          <asp:TableCell runat="server" /> 
          <asp:TableCell runat="server">
            <asp:Button ID="Button3_VSMode" runat="server" Text="Change" onclick="Button3_VSMode_Click" />
          </asp:TableCell>
          <asp:TableCell runat="server" HorizontalAlign="Right">
            <asp:Label ID="Label3_VSMode" runat="server"></asp:Label>
          </asp:TableCell>
        </asp:TableRow>
      </asp:Table>
    </div>
    </form>
</body>
</html>
